
## ========================================================= ##
## Only Modify Here, if you want to add a driver directory   ##
## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ##
## ========================================================= ##
list(APPEND LST_ASTRAL *)


include_directories(${CMAKE_CURRENT_LIST_DIR})



## usually, do not need to modify things below this line
## ========================================================= ##

set(THIS_LIBNAME device)
project(${THIS_LIBNAME})

foreach(SUBMOD ${LST_ASTRAL})
    file(GLOB_RECURSE SRCS_C ${CMAKE_CURRENT_LIST_DIR}/${SUBMOD}/*.c)
    file(GLOB_RECURSE SRCS_S ${CMAKE_CURRENT_LIST_DIR}/${SUBMOD}/*.S)
    list(APPEND SRCS ${SRCS_C} ${SRCS_S})
endforeach()

file(GLOB_RECURSE SRCS_C ${CMAKE_CURRENT_LIST_DIR}/*.c)
file(GLOB_RECURSE SRCS_S ${CMAKE_CURRENT_LIST_DIR}/*.S)
list(APPEND SRCS ${SRCS_C} ${SRCS_S})

## ===================================== ##
## Generally, it is NOT been supposed    ##
## to modify the code below this line.   ##
## ===================================== ##

message(STATUS "\n-- [^.^]********${THIS_LIBNAME}********[^.^]")
message(STATUS "The sources in [ " ${CMAKE_CURRENT_LIST_DIR} " ] are:")
foreach(SRC ${SRCS})
    message(STATUS "[src] " ${SRC})
endforeach()

add_library(${THIS_LIBNAME} STATIC ${SRCS})
merge_sections(${THIS_LIBNAME})